import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

drive = webdriver.Chrome()
drive.maximize_window()
drive.get("https://sahitest.com/demo/promptTest.htm")
time.sleep(1)
drive.find_element(By.NAME, "b1").click()
time.sleep(3)
#在alert里面输入内容
drive.switch_to.alert.send_keys("测试alert")
time.sleep(3)
# 点击确定按钮
drive.switch_to.alert.accept()
time.sleep(2)
drive.close()
